/** When your routing table is too long, you can split it into small modules**/
import pageComponentName from '@/config/page-component-name'

const orderRouter = [
  {
    path: '/order',
    component: () => import('../../layout/index.vue'),
    // redirect: '/order/new',
    name: 'order',
    meta: {
      title: '服务工单',
      icon: 'Tickets',
    },
    children: [
      {
        path: 'new',
        component: () => import('@/views/order/new/index.vue'),
        name: 'newOrder',
        meta: {
          title: '新建工单',
          keepAlive: true,
          componentName: pageComponentName.order.orderCreate,
        },
        hidden: true,
      },
      {
        path: 'list',
        component: () => import('@/views/order/list/index.vue'),
        name: 'orderList',
        meta: {
          title: '工单列表',
          keepAlive: true,
          componentName: pageComponentName.order.orderList,
        },
      },
      {
        path: 'parts',
        component: () => import('@/views/order/parts/index.vue'),
        name: 'orderParts',
        meta: {
          title: '工单配件',
          keepAlive: true,
          componentName: pageComponentName.order.orderPart,
        },
      },
      {
        path: 'ocost',
        component: () => import('@/views/order/ocost/index.vue'),
        name: 'orderCost',
        meta: {
          title: '工单费用',
          keepAlive: true,
          componentName: pageComponentName.order.orderFee,
        },
      },
      //跳转页面
      {
        path: 'odetail/:id',
        component: () => import('@/views/order/list/odetail/index.vue'),
        name: 'oDetail',
        meta: {
          title: '工单详情',
          keepAlive: true,
          componentName: pageComponentName.order.orderDetail,
        },
        hidden: true,
      },
      {
        path: 'imporder',
        component: () => import('@/views/order/list/imporder/index.vue'),
        name: 'impOrder',
        meta: {
          title: '导入工单',
          keepAlive: true,
          componentName: pageComponentName.common.import,
        },
        hidden: true,
      },
      {
        path: 'preturn',
        component: () => import('@/views/order/parts/preturn/index.vue'),
        name: 'pReturn',
        meta: {
          title: '旧件退回',
          keepAlive: true,
          componentName: pageComponentName.order.returnOldPart,
        },
        hidden: true,
      },
      {
        path: 'archived',
        component: () => import('@/views/order/archived/index.vue'),
        name: 'archived',
        meta: {
          title: '归档列表',
          keepAlive: true,
          componentName: pageComponentName.order.archiveList,
        },
      },
      // {
      //   path: 'settlement',
      //   component: () => import('@/views/order/settlement/index.vue'),
      //   name: 'settlement',
      //   meta: { title: '结算列表', keepAlive: true },
      // },
      {
        path: 'orderExcelImport',
        component: () => import('@/views/excel/index.vue'),
        name: 'orderExcelImport',
        meta: {
          title: '工单资料导入',
          keepAlive: true,
          componentName: pageComponentName.common.import,
        },
        hidden: true,
      },
    ],
  },
]

export default orderRouter
